import MySQLdb
import time
import random
import operator

db=MySQLdb.connect(host="localhost",user="root", passwd="",db="phone_tracker")
c=db.cursor()
c.executemany(""" TRUNCATE TABLE  `resultset-location`""",[()])
long = 1
lat = 1
x = 3 
y = 4
i = 0
for y in range(1,y+1):
    for x in range(1,x+1):
        hostname = "Host "+ str(i)
        c.executemany(
        """
        INSERT INTO `resultset-location` (`hostname`, `location`, `suburb`, `postcode`, `latitude`, `longitude`)
        VALUES (%s, %s, %s, %s, %s, %s)
        """,
        [
        (hostname, i, i, "POSTCODE", float(y), float(x))
        ]) 
        i = i+1
		
db.query("""SELECT * FROM `resultset-location`""")
r=db.use_result()
db.close();